<template>
	<view class="service">
		<view class="top">
			<view class="top_title">
				<view class="">服务</view>
				<view class="top_right">
					<image src="../../static/img/ic_search.png"
					 @click="navService({url:'../search/search'})"></image>
				</view>
			</view>
			<view class="top_list">
				<image v-for="(item,index) in topList" :src="item.icon" :key="index"
				 @click="navService(item)"></image>
			</view>
		</view>
		<view class="list" v-for="service in serviceList">
			<view class="list_title">{{service.title}}</view>
			<view class="list_mouleInc">
				<view :class="item.icon?'list_moule':'list_moule visHidden'"
				 v-for="(item,index) in service.content" :key="index" @click="navService(item)">
					<image :src="item.icon"></image>
					<view>{{item.text}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { assistauthscan } from '../../api/index.js'
	export default {
		onLoad() {
			
		},
		data() {
			return {
				topList:[
					{
						id:'devicemanage',
						url:'../devicemanage/devicemanage',
						icon:'../../static/img/service_bg1.png'
					},
					{
						id:'datamap',
						url:'../datamap/datamap',
						icon:'../../static/img/service_bg2.png'
					}
				],
				//flex布局后面2个隐藏且高度为0才可以实现自动换行
				serviceList:[
					{
						title:'审批管理',
						content:[
							{
								id:'wcld',
								icon:'../../static/img/service_wcld.png',
								text:'我处理的',
								url:'../mydeal/mydeal'
							},
							{
								id:'wfqd',
								icon:'../../static/img/service_wfqd.png',
								text:'我发起的',
								url:'../myrelease/myrelease'
							},
							{
								icon:'',
								text:''
							},
							{
								icon:'',
								text:''
							}
						]
					},
					{
						title:'活动管理',
						content:[
							{
								id:'shhd',
								icon:'../../static/img/service_shhd.png',
								text:'商户活动',
								url:'../merchantact/merchantact'
							},
							{
								id:'ylysf',
								icon:'../../static/img/service_ylysf.png',
								text:'银联云闪付',
								url:'../bankpay/bankpay'
							},
							{
								id:'ysfwl',
								icon:'../../static/img/service_ysfwl.png',
								text:'云闪付物料',
								url:'../paydata/paydata'
							},
							{
								icon:'',
								text:''
							},
							{
								icon:'',
								text:''
							}
						]
					},
					{
						title:'商户协助',
						content:[
							{
								id:'sqsh',
								icon:'../../static/img/service_sqsh.png',
								text:'商圈商户',
								url:'../merchants/merchants'
							},
							{
								id:'dyewm',
								icon:'../../static/img/service_ydym.png',
								text:'打印二维码',
								url:'../nearbyset/nearbyset'
							},
							{
								id:'storeCode',
								icon:'../../static/img/ic_storecode.png',
								text:'门店码',
								url:'../storeCode/storeCode'
							},
							// {
							// 	id:'shrz',
							// 	icon:'../../static/img/service_shrz.png',
							// 	text:'工单测试'
							// },
							{
								icon:'',
								text:''
							},
							{
								icon:'',
								text:''
							}
						]
					},
					{
						title:'其他工具',
						content:[
							// {
							// 	id:'cmsh',
							// 	icon:'../../static/img/service_psdbd.png',
							// 	text:'超盟商户'
							// },
							{
								id:'uptj',
								icon:'../../static/img/service_xmfyj.png',
								text:'U品推荐',
								url:'../Urecommend/Urecommend'
							},
							// {
							// 	id:'gzh',
							// 	icon:'../../static/img/service_wxshrz.png',
							// 	text:'公众号'
							// },
							{
								id:'jfm',
								icon:'../../static/img/service_jfm.png',
								text:'积分码',
								url: '../gradecode/gradecode'
							},
							// {
							// 	id:'jyd',
							// 	icon:'../../static/img/service_cmjyd.png',
							// 	text:'经营贷'
							// },
							{
								icon:'',
								text:''
							},
							{
								icon:'',
								text:''
							}
						]
					}
				]
			}
		},
		methods: {
			// 服务页面跳转函数
			navService:function(item){
				if(item.id == 'jyd' || item.id == 'gzh' ||
				 item.id == 'cmsh'){
					uni.showToast({
						icon:'none',
						title:'功能正在开发中'
					})
				}else if(item.id == 'shrz'){ //工单测试
				// 本地 http://10.8.0.160:8082/#/workOrder/mobile
				// 测试 http://192.168.0.66/#/workOrder/mobile
				// 线上 https://kefu.triumen.cn/#/workOrder/mobile
					window.location.href = 'http://192.168.0.66/#/workOrder/mobile'
				}else{
					uni.navigateTo({
						url: item.url
					});
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.visHidden{
		height: 0;
		visibility: hidden;
	}
	
	.service{
		padding: 0 28rpx 100rpx 28rpx;
		.top{
			.top_title{
				font-size: $uni-font-size-big;
				font-weight: bold;
				padding: 20rpx 0;
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				.top_right{
					image{
						width: 40rpx;
						height: 40rpx;
						vertical-align: text-bottom;
						margin-left: 20rpx;
					}
				}
			}
			.top_list{
				image{
					width: 50%;
					height: 180rpx;
				}
			}
		}
		.list{
			color: #333333;
			.list_title{
				font-size: $uni-font-size-big;
				font-weight: bold;
				margin-bottom: 30rpx;
			}
			.list_mouleInc{
				display: flex;
				display: -webkit-flex;
				justify-content: space-between;
				flex-direction: row;
				flex-wrap: wrap;
				margin-bottom: 30rpx;
				.list_moule{
					text-align: center;
					width: 25%;
					margin-bottom: 20rpx;
					image{
						width: 90rpx;
						height: 90rpx;
					}
					view{
						font-size: $uni-font-size-base;
					}
				}
			}
			
		}
	}
	
</style>
